<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<title>Cameras</title>
<link rel="stylesheet" type="text/css" href="../style.css">
</head>

<body>

<div align="center">
<table class=allEncompassingTable >
 <tr>
  <td >
<p><a href="../index.html" TARGET="_top"><img src="images/homeImg.png"></a></p>



<h1>Cameras <img src="images/cameras1.jpg"></h1>



<p>Cameras are <a href="viewableObjects.htm">viewable objects</a>, which means that you can <em>look through</em> them and display a view of what they are <em>looking at</em>. You can have as many cameras as needed in your <a href="scenes.htm">scene</a>, each one of them offering a different <a href="pagesAndViews.htm">view</a> of the scene. Following shows an example of a scene containing several cameras:<br>
</p>

<p align=center><img src="images/cameras2.jpg"></p>
<p class=imageLabel>[Scene displaying views of three different cameras]</p>
<br>

<p>Make sure not to mix-up cameras with <a href="visionSensors.htm">vision sensors</a>. Following are the main differences: </p>

<li>A camera has no specific resolution (i.e. it adjusts automatically to the view size). A vision sensor has a fixed resolution.</li>
<li>A camera's image content is not directly available via the <a href="apisOverview.htm">API</a> (but via a callback mechanism), and image processing not directly supported. A vision sensor's image content can be accessed via the API, and processed via the <a href="visionCallbackFunctions.htm">vision callback functions</a>.</li>
<li>A camera generally requires less CPU time and operates faster than vision sensors. </li>
<li>A camera can display all <a href="objects.htm">object types</a>. A vision sensor can only display <a href="renderableObjects.htm">renderable objects</a>.</li>

<p>A camera can be added to the scene with [Menu bar --&gt; Add --&gt; Camera]. However adding a camera in this way will add the <a href="objects.htm">object</a> in a default position and orientation. It is a better practice to add cameras by right-clicking on a specific view of a scene and selecting [Popup menu --&gt; Add --&gt; Camera]. This will add the object just in front of the current view. The added camera is automatically selected and you can then <em>look through it</em> with [Popup menu --&gt; View --&gt; Associate view with selected camera]. For this to work you will have to make sure the popup menu is activated on a view. When a view is created but not yet associated with a viewable object, the [Popup menu --&gt; Add --&gt; Camera] command will add a camera and directly associate it with the view (i.e. <em>look through it</em>). A camera can be associated with any number of views.<br>
</p>

<p>Alternatively you can also associate a view with a camera by activating following popup in a view: [Popup menu --&gt; View --&gt; View selector..]. This will allow you to select the desired camera view from a preview window. When a camera is associated with a view, it can be manipulated with the mouse with following toolbar buttons:<br>
</p>

<p align=center><img src="images/cameras4.jpg"></p>
<p class=imageLabel>[Camera navigation toolbar buttons: pan, rotate, shift, zoom, fit-to-view and fly]</p>
<br>


<li><strong>Pan button</strong>: allows shifting the camera in a perpendicular plane to the view direction. The clicked point in the scene will shift at the same rate as the mouse movement. If no specific point is clicked (i.e. when the background is clicked), the shift operation will be performed for an invisible point close to the camera.<br>
</li>

<li><strong>Rotate button</strong>: allows rotating the camera about the clicked point in the scene. If no specific point is clicked (i.e. when the background is clicked), the rotate operation will be performed about an invisible point close to the camera.<br>
</li>

<li><strong>Shift button</strong>: allows shifting the camera along the view direction. This has a zoom effect on camera views that are in perspective projection mode, but camera views in orthogonal projection mode might not see any effect (the cameras will however be shifted along their view direction).<br>
</li>

<li><strong>Camera angle button</strong>: allows adjusting the perspective projection angle of a camera view (when in perspective projection mode), or allows adjusting the view size of a camera view (when in orthogonal projection mode).<br>
</li>

<li><strong>Fit-to-view button</strong>: adjusts the camera of the view that has the focus in order to nicely frame all selected objects, or the entire scene if no object is selected.<br>
</li>

<li><strong>Fly button</strong>: allows &quot;flying&quot; through a scene. The mouse x and y movements are translated into yaw and pitch movements. Acceleration and deceleration is achieved with the shift- and ctrl-keys respectively. When the shift and ctrl keys are held down at the same time, the mouse x and y movements then perform a translation along the camera's x and y axes. In addition to this, the cursor keys allow orienting the camera into a different direction than the flight direction (during flight).
</li>

<p>While the left mouse button allows above operations, the wheel of the mouse allows shifting the camera along the view direction (if the camera view is in perspective projection mode) or allows adjusting the view size of the camera view (if the camera view is in orthogonal projection mode). The right button, when clicked without a mouse movement will activate a popup menu, however, if the right button is kept pressed while moving the mouse, a camera rotation about the clicked point can be achieved.<br>
</p>

<p>When the camera shift button is activated, it is very easy to navigate in the scene to any desired position and orientation using: (1) the left mouse button for shifting perpendicular to the view direction, (2) the mouse wheel for shifting along the view direction, and (3) the right mouse button for rotating about the clicked point:<br>
</p>

<p align=center><img src="images/cameras5.jpg"></p>
<p class=imageLabel>[Default camera navigation: (1) pan with left mouse button, (2) shift with mouse wheel, (3) rotate with right mouse button]</p>
<br>

<p>Cameras can automatically track objects (i.e. follow them as they move) by selecting the object to track, then selecting in the appropriate view [Popup menu --&gt; View --&gt; Track selected object]. A tracking camera will keep its position, but automatically adjust its viewing direction in order to always keep the object to track in its view field. This is different from having a camera attached to that object through a parent-child relationship.
</p>


<br>
<h3 class=recommendedTopics>Recommended topics</h3>
<li><a href="apiFunctionListCategory.htm#cameraObject">Related API functions</a></li>
<li><a href="cameraPropertiesDialog.htm">Camera  dialog</a></li>
<li><a href="viewableObjects.htm">Viewable objects</a></li>
<li><a href="pagesAndViews.htm">Pages and views</a></li>
<li><a href="visionSensors.htm">Vision sensors</a></li>

<br>
<br>

 </tr>
</table> 
</div>  
  
  
</body>

</html>
